package com.glsc.ngateway.common.api.amdoc.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.glsc.ngateway.common.api.common.enums.DictConstant;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @Author: libj
 * @Date: 2023/10/30
 * @Desc: 分级产品信息
 */

@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class ProdGradeDto implements Serializable {
    private Integer gradeId;

    @ApiModelProperty(value = "分级产品代码")
    private String gradeProdCode;

    @ApiModelProperty(value = "分级产品名称")
    private String gradeProdName;

    @ApiModelProperty(value = "分级类别 字典: am_prod_share_type")
    private String gradeType;

    @ApiModelProperty(value = "产品唯一编码")
    private String parentProdUniqueId;

    @ApiModelProperty(value = "删除状态，字典 YesNo:（N=未删除(默认) Y=已删除)")
    private String deleted = DictConstant.NO;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "创建时间 yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "创建人ID")
    private String createOperator;

    @ApiModelProperty(value = "创建人姓名")
    private String createOperatorName;

    @ApiModelProperty(value = "操作来源")
    private String opSource;

    @ApiModelProperty(value = "操作动作(增加、修改)")
    private String opAction;

    @ApiModelProperty(value = "操作人员ID")
    private String opOperator;

    @ApiModelProperty(value = "操作人员姓名")
    private String opOperatorName;

    @ApiModelProperty(value = "操作时间 yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime opTime;
}

